package com.milo.thread;

/**
 * @author: Milogenius
 * @create: 2019-04-25 16:14
 * @description:
 **/
public class Synchronized {
    public static void main(String[] args) {

        // 对Synchronized Class对象进行加锁
        synchronized (Synchronized.class) {
        }
        // 静态同步方法，对Synchronized Class对象进行加锁
        m();
    }

    public static synchronized void m() {
        System.out.println("同步方法执行了");
    }
}
